<template>
  <div>
    <!--病例页面-->
    <el-row>
      <el-col :span="24" :offset="0" style="margin-top:30px;">

        <el-form :label-position="labelPositionTop" :inline="true" :model="formInline" class="" >
          <!--class widthHeight40  style="width: 270px;line-height:40px;float:left;"-->
          <el-form-item align="left" label="姓名" class="height40-2" style="width:270px;">
            <el-input v-model="formInline.patient.name" placeholder="姓名"></el-input>
          </el-form-item>
          <el-form-item align="left" label="患者卡号" class="height40-2" style="width:270px;">
            <el-input v-model="formInline.patient.cardnum" placeholder="患者卡号"></el-input>
          </el-form-item>
          <el-form-item align="left" label="患者年龄" class="height40-2" style="width:270px;">
            <el-input v-model="formInline.patient.age" placeholder="患者年龄"></el-input>
          </el-form-item>
          <el-form-item align="left" label="出生日期" class="height40-2" style="width:270px;">
            <el-input v-model="formInline.patient.birth" placeholder="出生日期"></el-input>
          </el-form-item>
          <el-form-item align="left" label="性别" class="height40-2" style="width:270px;">
            <el-input v-model="formInline.patient.sex" placeholder="性别"></el-input>
          </el-form-item>
          <el-form-item align="left" label="手机号码" class="height40-2" style="width:270px;">
            <el-input v-model="formInline.patient.phone" placeholder="手机号码"></el-input>
          </el-form-item>
          <el-form-item align="left" label="证件号码" class="height40-2" style="width:270px;">
            <el-input v-model="formInline.patient.identityId" placeholder="证件号码"></el-input>
          </el-form-item>
          <el-form-item align="left" label="接诊类型" class="height40-2" style="width:270px;">
            <el-input v-model="formInline.acceptType" placeholder="接诊类型"></el-input>
          </el-form-item>
          <el-form-item align="left" label="地址" class="height40-2" style="width:640px;">
            <el-input v-model="formInline.patient.address" placeholder="地址"></el-input>
          </el-form-item><br/>
          <el-form-item align="left" label="诊断" class="height40-2" style="width:640px;">
            <el-input v-model="form2.diagnose" placeholder="诊断"></el-input>
          </el-form-item>
          <el-form-item align="left" label="医嘱" class="height40-2" style="width:640px;">
            <el-input v-model="form2.prn" placeholder="医嘱"></el-input>
          </el-form-item>
        </el-form>

      </el-col>
    </el-row>


    <!--体格信息-->
    <el-row>
      <el-col :span="24" :offset="0" style="margin-top:20px;">

        <div style="text-align: left;font-size: 20px;color: red"><strong>体格信息</strong></div>
        <el-form :inline="true" :model="form2" class="" >
          <el-form-item align="left" label="体温" class="height40" style="">
            <el-input v-model="form2.temperature" placeholder="体温" style="width:100px;"></el-input>
          </el-form-item>
          <el-form-item align="left" label="℃" class="height40-2" style=""></el-form-item>

          <el-form-item align="left" label="呼吸" class="height40" style="">
            <el-input v-model="form2.breathe" placeholder="呼吸" style="width:100px;"></el-input>
          </el-form-item>
          <el-form-item align="left" label="次/分" class="height40-2" style=""></el-form-item>

          <el-form-item align="left" label="脉搏" class="height40" style="">
            <el-input v-model="form2.pulse" placeholder="脉搏" style="width:100px;"></el-input>
          </el-form-item>
          <el-form-item align="left" label="次/分" class="height40-2" style=""></el-form-item>

          <el-form-item align="left" label="血压" class="height40" style="">
            <el-input v-model="form2.blood" placeholder="血压"style="width:100px;"></el-input>
          </el-form-item>
          <el-form-item align="left" label="mmhg" class="height40-2" style=""></el-form-item>

          <el-form-item align="left" label="身高" class="height40" style="">
            <el-input v-model="form2.heigth" placeholder="身高"style="width:100px;"></el-input>
          </el-form-item>
          <el-form-item align="left" label="cm" class="height40-2" style=""></el-form-item>

          <el-form-item align="left" label="体重" class="height40" style="">
            <el-input v-model="form2.weight" placeholder="体重"style="width:100px;"></el-input>
          </el-form-item>
          <el-form-item align="left" label="Kg" class="height40-2" style=""></el-form-item>

          <el-form-item align="left" label="血糖" class="height40" style="">
            <el-input v-model="form2.bloodSugar" placeholder="血糖"style="width:100px;"></el-input>
          </el-form-item>
          <el-form-item align="left" label="mmol/l " class="height40-2" style=""></el-form-item>

          <el-form-item align="left" label="血脂" class="height40" style="">
            <el-input v-model="form2.bloodLipids" placeholder="血脂"style="width:100px;"></el-input>
          </el-form-item>
          <el-form-item align="left" label="mmol/l" class="height40-2" style=""></el-form-item>
        </el-form>

      </el-col>
    </el-row>


    <!--病历信息-->
    <el-row>
      <el-col :span="24" :offset="0" style="margin-top:20px;">
        <div style="text-align: left;font-size: 20px;color: red"><strong>病历信息</strong></div>
        <el-form :label-position="labelPositionRight" :model="form3" class="" >

          <el-form-item label="发病日期" align="left" style="line-height:40px;float:left;">
            <el-input v-model="form2.date" placeholder="发病日期"  style="width:700px;"></el-input>
          </el-form-item>
          <el-form-item label="主诉" align="right" style="line-height:40px;float:right;">
            <el-input v-model="form2.chiefComplaint" placeholder="主诉" style="width:700px"></el-input>
          </el-form-item>
          <el-form-item label="现病史" align="left" style="line-height:40px;float:left;">
            <el-input v-model="form2.phi" placeholder="现病史" style="width:700px"></el-input>
          </el-form-item>
          <el-form-item label="既往史" align="right" style="line-height:40px;float:right;">
            <el-input v-model="form2.pastHistory" placeholder="既往史" style="width:700px"></el-input>
          </el-form-item>
          <el-form-item label="过敏史" align="left" style="line-height:40px;float:left;">
            <el-input v-model="form2.allergic" placeholder="过敏史" style="width:700px"></el-input>
          </el-form-item>
          <el-form-item label="个人史" align="right" style="line-height:40px;float:right;">
            <el-input v-model="form2.personal" placeholder="个人史" style="width:700px"></el-input>
          </el-form-item>
          <el-form-item label="家族史" align="left" style="line-height:40px;float:left;">
            <el-input v-model="form2.family" placeholder="家族史" style="width:700px"></el-input>
          </el-form-item>
          <el-form-item label="辅助检查" align="right" style="line-height:40px;float:right;">
            <el-input v-model="form2.assist" placeholder="辅助检查" style="width:700px"></el-input>
          </el-form-item>
          <el-form-item label="治疗意见" align="left" style="line-height:40px;float:left;">
            <el-input v-model="form2.opinion" placeholder="治疗意见" style="width:700px"></el-input>
          </el-form-item>
          <el-form-item label="备注" align="right" style="line-height:40px;float:right;">
            <el-input v-model="form2.remarks" placeholder="备注" style="width:700px"></el-input>
          </el-form-item>
        </el-form>

      </el-col>
    </el-row>

    <el-row :gutter="0">
      <el-col :span="2" :offset="22" style="height:40px;line-height:40px;">
        <el-button type="success" @click="insertFun">保存病例</el-button>
      </el-col>
    </el-row>



  </div>
</template>

<script>
  import axios from 'axios'
  export default {
    data() {
      return {
        labelPositionTop: 'top',
        labelPositionRight:'right',
        formInline: {
        },
        form2:{},
        form3:{},
      }
    },
    methods: {
      insertFun() {
        axios.post("api/medicalhistory/insert",this.form2).then(res=>{
          if(res.data=="success"){
              alert("成功")
          }
        })
      },
      go:function () {
        this.$router.push("/recipe ")
      },
      findByRegistId(registId){
        axios.post("api/registration/selectById",{registId:registId}).then(res=>{
          this.formInline=res.data;
        });
      },
    },
    mounted(){
      var registId=sessionStorage.getItem("registId");
      var diagnose=this.$route.params.diagnose;
      var prn=this.$route.params.prn;

      this.form2.registId="202010151201";
      this.findByRegistId("202010151201");//202010151414
    }
  }
</script>

<style scoped>
  .width100Height40{
    width: 100px;line-height:40px;float:left;margin-right:40px;
  }
  .height40{
    line-height:40px;float:left;
  }
  .height40-2{
    line-height:40px;float:left;margin-right:40px;
  }

</style>

